#! /usr/bin/env python
# -*- coding: utf-8 -*-

warn_name = '液氨'
warn_level = '蓝色预警'
warn_level_key = 4
company_name = '福建优力特材料有限公司'
company_id = '1820379858379681793'
warn_start_time = '2025-03-27 00:00:00'
warn_end_time = '2025-03-28 00:00:00'
deal_start_time = '2025-03-28 00:00:00'
deal_end_time = '2025-03-28 14:24:00'
warn_status = '已消警'
warn_status_key = 'extinguished_warn'
deal_status = '已处置'
deal_status_key = 'disposed'

query_sql = '''
SELECT
	count(*) 
FROM
	hgyq_major_hazard_sources.mw_m_warn_info 
WHERE
	is_deleted = 0 
	AND warn_level = ''' + str(warn_level_key) + '''
	AND create_dept = "''' + company_id + '''" 
	AND warn_name LIKE "%''' + warn_name + '''%" 
	AND warn_status = "''' + warn_status_key + '''" 
	AND disposal_status = "''' + deal_status_key + '''" 
	AND warn_time BETWEEN "''' + warn_start_time + '''" AND "''' + warn_end_time + '''"
	AND disposal_complete_time BETWEEN "''' + deal_start_time + '''" AND "''' + deal_end_time + '''"
'''

reset_sql = '''
SELECT
	count(*) 
FROM
	hgyq_major_hazard_sources.mw_m_warn_info 
WHERE
	is_deleted = 0 
	AND create_dept = "''' + company_id + '''" 
	AND warn_status = "''' + warn_status_key + '''" 
	AND disposal_status = "''' + deal_status_key + '''" 
'''
